//
//  CXmppMgr.h
//  wanzhaoIM
//
//  Created by liuyuantao on 15/4/7.
//  Copyright (c) 2015年 liuyuantao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "XMPP.h"
#import "XMPPReconnect.h"
#import "XMPPAutoPing.h"
#import "Reachability.h"


#define K_XMPPDIDGETDEPTREE @"K_XMPPDIDGETDEPTREE"
#define K_XMPPDIDGETKEFULIST @"K_XMPPDIDGETKEFULIST"
#define K_XMPPDIDGERECENTLYLIST @"K_XMPPDIDGERECENTLYLIST"
#define K_XMPPDIDGETWAIBULIST @"K_XMPPDIDGETWAIBULIST"
#define K_XMPPLOGINRESULT @"xmpp_login_result"
#define K_XMPPLOGINSTATUS @"xmpp_login_status"
#define K_XMPPLOGINERRMSG @"xmpp_login_errorMsg"
#define K_XMPPMODIFYINFO @"xmpp_modifyInfo"
#define K_XMPPRECEIVEERROR @"xmpp_receiveError"
#define K_XMPPDIDFAILEDRECEIVEIQ @"xmpp_didFailedreceiveIq"
#define K_XMPPUPDATESIGNATURE @"xmpp_updateSignature"
#define K_XMPPUPDATEPASSWORD @"xmpp_updatePassword"
#define K_XMPPGETUSETINFO @"xmpp_getUserInfo"
#define K_XMPPRECEIVEMESSAGE @"xmpp_receiveMessage"
#define K_XMPPSETNOTICESETTING @"xmpp_setNoticesetting"
#define K_XMPPDIDSENDMESSAGE @"xmpp_didSendMessage"
#define K_XMPPGETGROUPMEMBERS @"xmpp_getGroupMembers"
#define K_XMPPDIDRECEIVEPRESENCE @"xmpp_receivePrensence"
#define K_XMPPDIDRECEIVEOFFLINE @"xmpp_receiveOffline"
#define K_XMPPFAILEDRECEIVEMESSAGE @"xmpp_failedReceiveMessage"
#define K_XMPPGETSERVERDATE @"xmpp_getServerDate"
#define K_XMPPSETTOKEN @"xmpp_setToken"
#define K_XMPPDIDFORCEQUIT @"xmpp_didForceQuit"
#define K_XMPPUPDATEORGNAZATION @"xmpp_updateOrgnization"
#define k_XMPPUPDATEGROUPLIST @"xmpp_rupdateGroupList"
#define K_XMPPUPDATEGROUPINFO @"xmpp_updateGroupInfo"
#define k_XMPPGETGROUPLIST @"xmpp_getGroupList"
#define K_XMPPUPDATEMESSAGERECORD @"xmpp_updateMessageRecorde"
#define K_XMPPDeleteGroup @"xmpp_deleteGroup"
#define K_XMPPDELETEUSER @"xmpp_DeleteUser"
#define K_XMPPUPDATEMESSAGESTATUES @"xmpp_UpdateMessageStatus"
#define K_XMPPCREATEDISCUSSION @"xmpp_createDiscussion"
#define K_XMPPSIGNOUTDISCUSSION @"xmpp_signOutDiscussion"
#define K_XMPPUPDATEDISCUSSIONINFO @"xmpp_updateDiscussionInfo"
#define K_XMPPDELDISCUSSMEM @"xmpp_delDiscussionMem"
#define k_XMPPGETDISCUSSIONLIST @"xmpp_getDiscussionList"
#define K_XMPPADDDISCUSSIONMEM @"xmpp_AddDiscussionMem"
#define K_XMPPGETDISCUSSIONMEMLIST @"xmpp_getDiscussionMemList"
#define K_XMPPReceiveComment @"K_XMPPReceiveComment"
#define K_XMPPReceiveShare @"K_XMPPReceiveShare"
#define K_XMPPDidGetShare @"K_XMPPDidGetShare"
#define K_XMPPDelShare @"K_XMPPDelShare"
#define K_XMPPDelComment @"K_XMPPDelComment"



@interface CXmppMgr : NSObject
{
    XMPPStream *xmppStream;
    XMPPReconnect *xmppReconnect;
    XMPPAutoPing *xmppAutoPing;
    NSString *passWord;
    NSString *userName;
    BOOL isXmppConnected;
}
@property (nonatomic, strong, readonly) XMPPStream *xmppStream;
@property (nonatomic, strong, readonly) XMPPReconnect *xmppReconnect;
@property (nonatomic, strong, readonly) XMPPAutoPing *xmppAutoPing;
@property (nonatomic, assign) NSInteger noticeNum;
@property (nonatomic, strong) Reachability *reachability;
StrongProperty dispatch_queue_t xmppMgrQueen;


+(CXmppMgr *)shareInstance;
- (BOOL)connect;
- (void)disconnect;
- (void)goOffline;

-(BOOL)connect:(NSString *)user password:(NSString *)password serverIp:(NSString *)serverIp  serverPort:(NSInteger)serverPort;

- (void)sendElement:(NSXMLElement *)element;
@end
